Image rotation using software for endoscopic applications

ABSTRACT

The disclosure extends to endoscopic devices and systems for image correction of a rotating sensor. The disclosure allows for the distal image sensor to rotate as the user rotates the lumen with respect to a fixed handpiece. The system includes an angle sensor located at the junction of the rotating lumen and the fixed handpiece. Periodic measurements of angle are used in the system&#39;s image processing chain in order to effect suitable software image rotations, thereby providing a final displayed image or video stream with the desired orientation.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims the benefit of U.S. Provisional Application No.61/792,119, filed Mar. 15, 2013, which is hereby incorporated byreference herein in its entirety, including but not limited to thoseportions that specifically appear hereinafter, the incorporation byreference being made with the following exception: In the event that anyportion of the above-referenced provisional application is inconsistentwith this application, this application supersedes said above-referencedprovisional application.

STATEMENT REGARDING FEDERALLY SPONSORED RESEARCH OR DEVELOPMENT

Not Applicable.

BACKGROUND

Advances in technology have provided advances in imaging capabilitiesfor medical use. One area that has enjoyed some of the most beneficialadvances is that of endoscopic surgical procedures because of theadvances in the components that make up an endoscope.

Conventional, digital video systems used for laparoscopy, arthroscopy,ENT, gynecology and urology are based upon conventional, rigidendoscopes, which are optically and mechanically coupled to a separatehand-piece unit. The hand-piece may comprise an image sensor(s). Imageinformation is optically transmitted along the length of the endoscope,after which it is focused upon the sensor via an optical coupler. Theendoscope is free to rotate with respect to the image sensor and theoperator will typically exploit this fact to cover a greater range of ascene of a surgical site when using endoscopes with a non-zero viewingangle. The orientation of the image as seen on the viewing display ormonitor depends on the orientation of the hand-piece unit with respectto the scene. Generally the user or operator of the hand-piece wishesthe vertical direction in the image to be the same direction as theirown upright direction.

BRIEF DESCRIPTION OF THE DRAWINGS

Non-limiting and non-exhaustive implementations of the disclosure aredescribed with reference to the following figures, wherein likereference numerals refer to like parts throughout the various viewsunless otherwise specified. Advantages of the disclosure will becomebetter understood with regard to the following description andaccompanying drawings where:

FIG. 1 illustrates an endoscopic device in accordance with theprinciples and teachings of the disclosure;

FIG. 2 illustrates an embodiment of an angle sensor in accordance withthe principles and teachings of the disclosure;

FIG. 3 illustrates an embodiment of an angle sensor in accordance withthe principles and teachings of the disclosure;

FIG. 4 illustrates an embodiment of an angle sensor in accordance withthe principles and teachings of the disclosure;

FIG. 5 illustrates one implementation of the endoscopic device, showingthe ability of the outer lumen, along with a distal lens, prism, andsensor, of the endoscope to rotate to create a wide angle field ofvision;

FIG. 6 illustrates one implementation of the endoscopic device, showingthe ability of the outer lumen, along with a distal lens, prism, andsensor of the endoscope to rotate to create a wide angle field ofvision;

FIGS. 7A and 7B illustrate a perspective view and a side view,respectively, of an implementation of a monolithic sensor having aplurality of pixel arrays for producing a three dimensional image inaccordance with the teachings and principles of the disclosure;

FIGS. 8A and 8B illustrate a perspective view and a side view,respectively, of an implementation of an imaging sensor built on aplurality of substrates, wherein a plurality of pixel columns formingthe pixel array are located on the first substrate and a plurality ofcircuit columns are located on a second substrate and showing anelectrical connection and communication between one column of pixels toits associated or corresponding column of circuitry; and

FIGS. 9A and 9B illustrate a perspective view and a side view,respectively, of an implementation of an imaging sensor having aplurality of pixel arrays for producing a three dimensional image,wherein the plurality of pixel arrays and the image sensor are built ona plurality of substrates.

DETAILED DESCRIPTION

For reasons of cost and simplicity, an improved endoscope design conceptinvolves placing an image sensor within the endoscope itself andtransmitting the image data to the remainder of the camera systemelectrically. In an implementation of the disclosure, the image sensormay be placed within a distal end of the endoscope. The challenge forsuch a system is to maintain high image quality using a sensor that isspace constrained. This challenge may be overcome by a system thatincorporates a monochrome image sensor with minimal peripheralcircuitry, connection pads and logic. Color information is provided bypulsing different frames with different wavelengths of light using,e.g., laser or LED light sources. The image sensor is able to captureframes within 1/120 s or less, thereby producing full color video at arate of 60 Hz or higher.

Another challenge arising from this approach is in providing a finalimage orientation for a user, which still reflects the hand-pieceorientation with respect to the scene. One, purely mechanical approachis to have the sensor be rigidly coupled to the hand-piece and to rotatethe endoscope, including the lens stack, at the front end independently.This may be accomplished by incorporating two concentric tubes. Thesystem allows for a distal prism to rotate, which changes the angle ofview of the user or operator, while the sensor remains fixed at aconstant location. This allows the device to be used in the same manneras expected by a user or operator experienced in using conventionalrigid endoscopy systems. The user or operator may rotate an outer lumen,thereby changing the angle of view, while the sensor remains in a fixedposition and the image viewable on screen remains at a constant horizon.The prism may rotate while the sensor does not rotate, such that theuser does not lose orientation.

This disclosure extends to an alternative approach in which the sensoris rigidly coupled, along with the lens stack, to a single tube whilethe digital images are rotated in the image signal processing pipelineor chain (ISP). The disclosure contemplates using a digitalrepresentation of the angle of the endoscope tube with respect to thehand-piece that is continuously available to the ISP during operation.Several approaches to this are possible, as described more fully herein.

The disclosure also extends to a solution for endoscopy applications inwhich the image sensor is resident at the distal end of the endoscope.With an image sensor located in the distal end of an endoscopic device,there are challenges present, which are not at issue when the imagingsensor is located remotely from the distal end of the endoscopic device.For example, when a user or operator rotates or changes the angle of theendoscopic device, which is common during a surgery, the image sensorwill change orientation and the image horizon shown on screen will alsochange. What is needed are devices and systems that accommodate an imagesensor being located in the distal end of the endoscopic device withoutchanging the orientation and maintaining a constant image horizon forthe user or operator. As will be seen, the disclosure provides devicesand systems that can do this in an efficient and elegant manner.

In the following description of the disclosure, reference is made to theaccompanying drawings, which form a part hereof, and in which is shownby way of illustration specific implementations in which the disclosuremay be practiced. It is understood that other implementations may beutilized and structural changes may be made without departing from thescope of the disclosure.

It must be noted that, as used in this specification and the appendedclaims, the singular forms “a,” “an,” and “the” include plural referentsunless the context clearly dictates otherwise.

As used herein, the terms “comprising,” “including,” “containing,”“characterized by,” and grammatical equivalents thereof are inclusive oropen-ended terms that do not exclude additional, unrecited elements ormethod steps.

Further, where appropriate, functions described herein can be performedin one or more of: hardware, software, firmware, digital components, oranalog components. For example, one or more application specificintegrated circuits (ASICs) can be programmed to carry out one or moreof the systems and procedures described herein. Certain terms are usedthroughout the following description and Claims to refer to particularsystem components. As one skilled in the art will appreciate, componentsmay be referred to by different names. This document does not intend todistinguish between components that differ in name, but not function.

Referring now to FIG. 1, an endoscopic device of the disclosure isillustrated. The mechanical structure of the endoscope 100 of thedisclosure comprises a hand-piece unit 110 and an endoscope tube 120,which freely rotate relative to each other. As illustrated best in FIG.1, the endoscope may also comprise an electrical cable 130 attached tothe hand-piece 110. A light cable 150 may be attached to the endoscope120. An image sensor 140 may be located within the hand-piece 110 or theendoscope tube 120, such that the rotation of the hand-piece 110relative to the endoscope tube 120 creates an image horizon that maychange depending upon the user's orientation of the hand-piece 110. Inan implementation, the image sensor 140 may be located in the distal endof the endoscope tube 120, such that the rotation of the hand-piece 110relative to the endoscope tube 120 creates an image horizon that maychange depending upon the user's orientation of the hand-piece 110. Tocompensate for this changing orientation, the disclosure may utilize thefollowing devices, methods and systems to detect an angle of thehand-piece 110 with respect to the endoscope tube 120.

Referring now to FIG. 2, in one implementation, a rotation-detectingHall-effect sensor 112 may be located in the hand-piece 110. The sensor112 may be used to detect the angle of a diametrically-polarized,magnetic annulus or disk 114 illustrated in FIG. 2. This type ofHall-effect sensor 112 produces a voltage, which indicates the directionof the magnetic field and may be used to determine the angle of theannulus or disk 114 and thus, the angle of the endoscope tube 120.

Referring now to FIG. 3, in one implementation, a potentiometer 212 maybe integrated into the junction between the hand-piece 110 and endoscopetube 120 illustrated in FIG. 1. The potentiometer 212 illustrated inFIG. 3 may comprise a carbon track or filament 213 that may be rigidlyattached to the endoscope tube 120. The potentiometer 212 may furthercomprise a wiper 214 that may be rigidly attached to the hand-piece 110.It will be appreciated that the resistance may be measured between oneend of the potentiometer 212 and the wiper 214, which will then indicatethe angle for the configuration illustrated in FIG. 3. A potentialdivider arrangement may also be used for which the voltage seen at thewiper 214 will provide the angle measurement.

Referring now to FIG. 4, in one implementation, a combination of an LEDor similar light source 312 and a light detector 313, such as aphotodiode or a phototransistor, may be incorporated into, or may bepart of, or may be attached to the hand-piece 110. A continuousreflecting annulus or disk 314, with variable reflectivity, may berigidly attached to the scope 120. The reflectivity may vary linearlywith the angle, or a set of mirrors of suitably varying reflectivity,may be located at regular angular intervals. The amount of light fromthe light source 312, such as an LED source or other light source,reflected back at or to the light detector 313 indicates the angle.

For each of the implementations discussed above, any pertinent resultantvoltage 300 is fed to an analog-digital converter (ADC) or digitizer400. The digital number is then relayed to the ISP or the cameraprocessing chain. The angle-sensing elements (112, 114; 212, 213, 214;and 312, 313, 314) discussed above may be placed into or as part of afixed hand-piece 110 where the scope 120 rotates with respect to thefixed hand-piece system, which is illustrated best in FIGS. 5 and 6. InFIG. 6, the hand-piece 110 has been removed for purposes of clarityonly.

As illustrated in FIGS. 5 and 6, the system may comprise a fixedhand-piece component 110 or set of components with a cylindrical openingon the distal end of the hand-piece. Within the cylindrical opening thescope 120 is restrained in the axial direction, but allowed to rotateabout the axis. In addition to the components mentioned with respect toFIG. 1, the system may further comprise an interface component 160 thatmay be fixed to the hand-piece 110, a rotation sleeve 170, a rotationpost 175, supporting electronics and circuitry 142 for the image sensor140, a sensor wire harness 144, a lens stack 180, which includes adistal prism, located distally of the scope tube 120, and a lens holder182. A method is shown in FIG. 6 where the combination of the rotationsleeve 170 and rotation post 175 act to constrain the scope 120 axially.There may be additional material between the interface component 160 andthe rotation sleeve 170 to either add or reduce friction to achieve atorque that is low enough to be ergonomically pleasing, but high enoughto prevent accidental rotation.

The rotation post 175 allows the user to rotate the scope 120 in a waythat is similar to rotating a conventional scope (as shown in FIG. 1).As the rotation post 175 rotates, the entire scope assembly alsorotates, including the distal imaging sensor 140 and attached lens stack180. As can be seen, the viewing angle dictated by the distal prismchanges and allows the user a broader or different view of the surgicalscene.

For each embodiment, the rotating and fixed components of the angledetection system can be mounted to the rotation sleeve 170 andhand-piece 110, respectively.

It will be appreciated that the digital angle information may be madeavailable to the image processing chain where it is sampled periodically(e.g., each frame) and quantized appropriately to, e.g., 5° or 10°,units. In order to prevent rapid angular oscillation of the final imagebetween adjacent angles, a degree of hysteresis is required. Oneapproach is to only allow an image transformation if the same quantizedangle has been observed consistently within the previous n samples,where n would be tuned to the satisfaction of the user.

The basis of rotation of an image plane through angle θ is described bythe following transformation:x ₂=(X ₁ −x ₀)cos θ−(Y ₁ −y ₀)sin θ+x ₀y ₂=(Y ₁ −y ₀)cos θ+(X ₁ −x ₀)sin θ+y ₀where (X₁, Y₁) are the original integer pixel coordinates, (x₂, y₂) arethe final real-number pixel coordinates and (x₀, y₀) marks the axis ofrotation. In general, unless θ is a multiple of 90°, x₂ and y₂ are notintegers. The pixel locations in the final image buffer can be filled bytruncating or rounding the (x₂, y₂) values to integer coordinates (X₂,Y₂):X ₂=int(x ₂)Y ₂=int(y ₂)

This approach results in multiple candidate cases and void pixels,however. The void pixels can be filled by nearest neighbor substitution,which has a resolution and artifact penalty, or by interpolation (e.g.,bilinear or bicubic), requiring an occupancy investigation in theirlocalities.

A more practical approach is afforded by taking each final integer pixellocation and applying the inverse rotation transformation to arrive atreal-number coordinates within the original plane:x ₁=(X ₂ −x ₀)cos θ+(Y ₂ −y ₀)sin θ+x ₀y ₁=(Y ₂ −y ₀)cos θ−(X ₂ −x ₀)sin θ+y ₀

Since pixel data within that plane are known to be at all integercoordinates, it is straightforward to derive an interpolated imagecontent estimate. This interpolation can again either be bilinear orbicubic, e.g., Bilinear interpolation requires knowing only the closestfour pixels, (two in each dimension). They are identified as (X_(a),Y_(a)), (X_(a), Y_(b)), (X_(b), Y_(a)) and (X_(b), Y_(b)), where:X _(a)=int(x ₁); X _(b)=1+int(x ₁)Y _(a)=int(y ₁); Y _(b)=1+int(y ₁)The convolution kernel is described by:

$\begin{pmatrix}{( {1 - \alpha} )( {1 - \beta} )} & {\beta( {1 - \alpha} )} \\{\alpha( {1 - \beta} )} & {\alpha\beta}\end{pmatrix}$ where; α = x₁ − X_(a) β = y₁ − Y_(a)in pixel units.

Referring now to FIGS. 7A and 7B, the figures illustrate a perspectiveview and a side view, respectively, of an implementation of a monolithicsensor 700 having a plurality of pixel arrays for producing a threedimensional image in accordance with the teachings and principles of thedisclosure. Such an implementation may be desirable for threedimensional image capture, wherein the two pixel arrays 702 and 704 maybe offset during use. In another implementation, a first pixel array 702and a second pixel array 704 may be dedicated to receiving apredetermined range of wave lengths of electromagnetic radiation,wherein the first pixel array 702 is dedicated to a different range ofwave length electromagnetic radiation than the second pixel array 704.

FIGS. 8A and 8B illustrate a perspective view and a side view,respectively, of an implementation of an imaging sensor 800 built on aplurality of substrates. As illustrated, a plurality of pixel columns804 forming the pixel array are located on the first substrate 802 and aplurality of circuit columns 808 are located on a second substrate 806.Also illustrated in the figure are the electrical connection andcommunication between one column of pixels to its associated orcorresponding column of circuitry. In one implementation, an imagesensor, which might otherwise be manufactured with its pixel array andsupporting circuitry on a single, monolithic substrate/chip, may havethe pixel array separated from all or a majority of the supportingcircuitry. The disclosure may use at least two substrates/chips, whichwill be stacked together using three-dimensional stacking technology.The first 802 of the two substrates/chips may be processed using animage CMOS process. The first substrate/chip 802 may be comprised eitherof a pixel array exclusively or a pixel array surrounded by limitedcircuitry. The second or subsequent substrate/chip 806 may be processedusing any process, and does not have to be from an image CMOS process.The second substrate/chip 806 may be, but is not limited to, a highlydense digital process in order to integrate a variety and number offunctions in a very limited space or area on the substrate/chip, or amixed-mode or analog process in order to integrate for example preciseanalog functions, or a RF process in order to implement wirelesscapability, or MEMS (Micro-Electro-Mechanical Systems) in order tointegrate MEMS devices. The image CMOS substrate/chip 802 may be stackedwith the second or subsequent substrate/chip 806 using anythree-dimensional technique. The second substrate/chip 806 may supportmost, or a majority, of the circuitry that would have otherwise beenimplemented in the first image CMOS chip 802 (if implemented on amonolithic substrate/chip) as peripheral circuits and therefore haveincreased the overall system area while keeping the pixel array sizeconstant and optimized to the fullest extent possible. The electricalconnection between the two substrates/chips may be done throughinterconnects 803 and 805, which may be wirebonds, bump and/or TSV(Through Silicon Via).

FIGS. 9A and 9B illustrate a perspective view and a side view,respectively, of an implementation of an imaging sensor 900 having aplurality of pixel arrays for producing a three dimensional image. Thethree dimensional image sensor may be built on a plurality of substratesand may comprise the plurality of pixel arrays and other associatedcircuitry, wherein a plurality of pixel columns 904 a forming the firstpixel array and a plurality of pixel columns 904 b forming a secondpixel array are located on respective substrates 902 a and 902 b,respectively, and a plurality of circuit columns 908 a and 908 b arelocated on a separate substrate 906. Also illustrated are the electricalconnections and communications between columns of pixels to associatedor corresponding column of circuitry.

It will be appreciated that the teachings and principles of thedisclosure may be used in a reusable device platform, a limited usedevice platform, a re-posable use device platform, or asingle-use/disposable device platform without departing from the scopeof the disclosure. It will be appreciated that in a re-usable deviceplatform an end-user is responsible for cleaning and sterilization ofthe device. In a limited use device platform the device can be used forsome specified amount of times before becoming inoperable. Typical newdevice is delivered sterile with additional uses requiring the end-userto clean and sterilize before additional uses. In a re-posable usedevice platform a third-party may reprocess the device (e.g., cleans,packages and sterilizes) a single-use device for additional uses at alower cost than a new unit. In a single-use/disposable device platform adevice is provided sterile to the operating room and used only oncebefore being disposed of.

Additionally, the teachings and principles of the disclosure may includeany and all wavelengths of electromagnetic energy, including the visibleand non-visible spectrums, such as infrared (IR), ultraviolet (UV), andX-ray.

The foregoing description has been presented for the purposes ofillustration and description. It is not intended to be exhaustive or tolimit the disclosure to the precise form disclosed. Many modificationsand variations are possible in light of the above teaching. Further, itshould be noted that any or all of the aforementioned alternateimplementations may be used in any combination desired to formadditional hybrid implementations of the disclosure.

Further, although specific implementations of the disclosure have beendescribed and illustrated, the disclosure is not to be limited to thespecific forms or arrangements of parts so described and illustrated.The scope of the disclosure is to be defined by the claims appendedhereto, any future claims submitted here and in different applications,and their equivalents.

What is claimed is:
 1. An endoscopic device comprising: a hand-piece; aproximal portion and a distal portion comprising a tip; a lumen; animage sensor disposed within the lumen for providing visualization of anarea, wherein the image sensor is at the distal portion near the tip ofthe endoscope; an angle sensor for detecting an angle of rotation of thehand-piece relative to the lumen; wherein the lumen is rotatable aboutan axis of the endoscope and with respect to the hand-piece; and animage signal processing pipeline for performing rotation transformationsupon images that are captured by the image sensor based on the angle ofrotation detected by the angle sensor, wherein the image signalprocessing pipeline is configured to rotate the images counter to theangle of rotation detected by the angle sensor to maintain a constantimage horizon for a user on a the display, and wherein an orientation ofrotated images for display on the display is rotationally different thanthe orientation of the lumen.
 2. The endoscopic device of claim 1,wherein the angle sensor is a rotation-detecting Hall-effect sensor. 3.The endoscopic device of claim 2, wherein the rotation-detectingHall-effect sensor is located in the hand-piece.
 4. The endoscopicdevice of claim 2, wherein the device further comprises adiametrically-polarized magnetic annulus and wherein therotation-detecting Hall-effect sensor produces a voltage that is used todetect an angle of the diametrically-polarized, magnetic annulus.
 5. Theendoscopic device of claim 1, wherein the angle sensor produces avoltage that is used to detect the angle of rotation of the hand-piecerelative to the lumen.
 6. The endoscopic device of claim 1, wherein theangle sensor is a potentiometer.
 7. The endoscopic device of claim 6,wherein the potentiometer comprises a carbon filament, wherein thecarbon filament of the potentiometer is disposed on said lumen.
 8. Theendoscopic device of claim 1, where the angle sensor comprises a lightsource and a photo diode that rotate relative to a gradient disc.
 9. Theendoscopic device of claim 8, wherein said photo diode detects theelectromagnetic energy from said light source that is reflected by saidgradient disc.
 10. The endoscopic device of claim 1, wherein said imagesensor incorporates a two-dimensional array of pixels capable ofdetecting electromagnetic radiation.
 11. The endoscopic device of claim10, wherein said image rotation transformation comprises taking eachinitial pixel's integer x,y coordinates and transforming them to final,real number pixel coordinates by applying a rotation kernel.
 12. Theendoscopic device of claim 11, wherein said image rotationtransformation further comprises truncating the final, real number pixelcoordinates to integer values, then assigning values to blank pixels ina final image using the values of nearby, filled pixels.
 13. Theendoscopic device of claim 12, wherein said assignment is performedusing bilinear interpolation.
 14. The endoscopic device of claim 12,wherein said assignment is performed using bicubic interpolation. 15.The endoscopic device of claim 12, wherein said assignment is performedusing nearest neighbor substitution.
 16. The endoscopic device of claim10, wherein said image rotation transformation comprises taking eachfinal pixel's integer x,y coordinates and transforming them to initialreal number x,y coordinates by applying an inverse rotation kernel. 17.The endoscopic device of claim 16, wherein said image rotationtransformation further comprises estimating a pixel value at the initialreal number x,y coordinates, using data from one or more closest integercoordinate locations.
 18. The endoscopic device of claim 17, whereinsaid estimation is performed using nearest neighbor substitution. 19.The endoscopic device of claim 17, wherein said estimation is performedusing bilinear interpolation.
 20. The endoscopic device of claim 17,wherein said estimation is performed using bicubic interpolation.
 21. Anendoscopic system comprising: an endoscope unit comprising: ahand-piece; a proximal portion and a distal portion comprising a tip; alumen; an image sensor disposed within the lumen for providingvisualization of an area, wherein the image sensor is at the distalportion near the tip of the endoscope; wherein said image sensorincorporates a two dimensional array of pixels capable of detectingelectromagnetic radiation; an angle sensor for detecting an angle ofrotation of the hand-piece relative to the lumen, wherein the lumen isrotatable about an axis of the endoscope and with respect to thehand-piece; and an image signal processing pipeline for performingrotation transformations upon images that are captured by the imagesensor based on the angle of rotation detected by the angle sensor,wherein the image signal processing pipeline is configured to rotate theimages counter to the angle of rotation detected by the angle sensor tomaintain a constant image horizon for a user on a display, and whereinan orientation of rotated images for display on the display isrotationally different than the orientation of the lumen.
 22. A methodof rotating an image in an endoscopic application comprising: providingan endoscope unit comprising: a hand-piece; a proximal portion and adistal portion comprising a tip; a lumen; an image sensor disposedwithin the lumen for providing visualization of an area, wherein theimage sensor is at the distal portion near the tip of the endoscope;wherein said image sensor incorporates a two dimensional array of pixelscapable of detecting electromagnetic radiation; detecting an angle ofrotation of the hand-piece relative to the lumen using an angle sensor,wherein the lumen is rotatable about an axis of the endoscope and withrespect to the hand-piece; performing image rotation transformationsupon images captured by the image sensor using an image signalprocessing pipeline based on the angle of rotation detected by the anglesensor, wherein the image signal processing pipeline is configured torotate the images counter to the angle of rotation detected by the anglesensor to maintain a constant image horizon for a user on a display, andwherein an orientation of rotated images for display on the display isrotationally different than the orientation of the lumen.
 23. The methodof claim 22, wherein the step of performing image rotationtransformation comprises taking each initial pixel's integer x,ycoordinates and transforming them to final, real number pixelcoordinates by applying a rotation kernel.
 24. The method of claim 23,wherein said image rotation transformation further comprises truncatingthe final, real number pixel coordinates to integer values, thenassigning values to blank pixels in a final image using the values ofnearby, filled pixels.
 25. The method of claim 24, wherein saidassignment is performed using bilinear interpolation.
 26. The method ofclaim 24, wherein said assignment is performed using bicubicinterpolation.
 27. The method of claim 24, wherein said assignment isperformed using nearest neighbor substitution.
 28. The method of claim22, wherein the step of performing image rotation transformationcomprises taking each final pixel's integer x,y coordinates andtransforming them to initial real number x,y coordinates by applying aninverse rotation kernel.
 29. The method of claim 28, wherein said imagerotation transformation further comprises estimating a pixel value atthe initial real number x,y coordinates, using the data from one or moreclosest integer coordinate locations.
 30. The method of claim 28,wherein said estimation is performed using nearest neighborsubstitution.
 31. The method of claim 28, wherein said estimation isperformed using bilinear interpolation.
 32. The method of claim 28,wherein said estimation is performed using bicubic interpolation.
 33. Anendoscopic device comprising: a hand-piece; a proximal portion and adistal portion comprising a tip; a lumen; an image sensor disposedwithin the lumen for providing visualization of an area, wherein theimage sensor is at the distal portion near the tip of the endoscope; anangle sensor for detecting an angle of rotation of the hand-piecerelative to the lumen; wherein the lumen is rotatable about an axis ofthe endoscope and with respect to the hand-piece; and an image signalprocessing pipeline for performing rotation transformations upon imagesthat are captured by the image sensor based on the angle of rotationdetected by the angle sensor, wherein the image signal processingpipeline is configured to: determine a quantized angle of rotation basedon the angle of rotation detected by the angle sensor; determine thatthe quantized angle of rotation has remained constant for at least aplurality of frames comprising a predetermine number of frames; and inresponse do determining that the quantized angle of rotation hasremained constant for at least the plurality of frames, rotate theimages counter to the angle of rotation detected by the angle sensor tomaintain a substantially constant image horizon for a user on thedisplay, and wherein an orientation of rotated images for display on thedisplay is rotationally different than the orientation of the lumen.